<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<form>
	<input type="hidden" id="type" name="type" value="BY_TEL"/>
	<input id="loginName" name="loginName" type="text"/>
	<input id="password" name="password" type="text"/>
	<input type="button" value="登录" onclick="login()"/>
</form>
<script type="text/javascript" charset="utf-8"
		src="${pageContext.request.contextPath}/common/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" charset="utf-8"
		src="${pageContext.request.contextPath}/js/common.js"></script>
<script type="text/javascript">
function login() {
	var param = {
			loginName : $("#loginName").val(),
			password : $("#password").val(),
			type : $("#type").val(),
			time : new Date()
	};
	var url = basePath + "/user/login"
	$.ajax({
		data : param,
		dataType : 'json',
		method : 'post',
		url : url,
		success : function(result) {
			if(result.result == 'SUCCESS') {
				window.location.href= basePath + "/activiti/process/definition";
			} else {
				alert("登录失败");
			}
		}
	});
}
	
</script>

</body>
</html>